package com.yuelan.order.controller;

import com.yuelan.common.core.web.controller.BaseController;
import com.yuelan.common.core.web.domain.AjaxResult;
import com.yuelan.common.log.annotation.Log;
import com.yuelan.common.log.enums.BusinessType;
import com.yuelan.common.security.annotation.Logical;
import com.yuelan.common.security.annotation.RequiresRoles;
import com.yuelan.common.security.handler.GlobalExceptionHandler;
import com.yuelan.order.service.RentOrderService;
import com.yuelan.order.domain.RentPayOrder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;

/**
 * @description: 用户租金订单
 * @Author: ZhaoYi
 * @date: 24-6-25 14:24
 */
@RestController
@RequestMapping("/pay")
public class RentOrderController extends BaseController {

    private static final Logger logger = LoggerFactory.getLogger(GlobalExceptionHandler.class);

    @Resource
    private RentOrderService rentOrderService;


    @PostMapping("/rent")
    @Log(title = "租金支付订单", businessType = BusinessType.INSERT)
    public void rentOrder(@RequestBody RentPayOrder rentPayOrder) {
        logger.info(rentPayOrder.toString());
        rentOrderService.createRentPayOrder(rentPayOrder);
    }


}
